﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JQuery
{
    public static partial class Extensions
    {
        public static bool TryParse<T>(this Enum oSrc, string value, ref T @enum)
        {
            bool result = true;

            try
            {
                @enum = (T)Enum.Parse(oSrc.GetType(), value, true);
            }
            catch
            {
                result = false;
            }

            return result;
        }
    }
}
